import request from './request'

const baseUrl = {
  sysUrl: 'http://api-rbac.nas.com',
  // sysUrl: 'http://127.0.0.1:8001',
  infoUrl: 'https://api.jlsmw.cn'
}

// sessionApi 判断是否已登录，并获取登录用户的信息
export const sessionApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/session'})
}
// imgCodeApi 获取图形验证码
export const imgCodeApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/common/img-code'})
}
// selAreaApi 获取省市区
export const selAreaApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/common/areas', params})
}
// loginApi 用户登录
export const loginApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/login', data})
}
// newNoteApi 获取图形验证码
export const newNoteApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/notice/new'})
}
// exitApi 用户退出
export const exitApi = () => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/exit'})
}
// menuApi 获取菜单
export const menuApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/module/menu'})
}
// modTreeApi 获取菜单
export const modTreeApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/module/tree'})
}

// saveModApi 新增、修改模块信息
export const saveModApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/module/save', data})
}
// delModsApi 批量删除模块信息
export const delModsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/module/deletes', data})
}
// oneModApi 获取模块详情信息
export const oneModApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/module/one', params})
}
// listModApi 获取模块信息树形列表
export const listModApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/module/list'})
}
// treeModApi 获取模块信息树形列表
export const treeModApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/module/tree', params})
}
// sortModApi 获取模块信息树形列表
export const sortModApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/module/sort', params})
}
// selModApi 获取模块及按钮信息树形列表
export const selModApi = () => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/module/select'})
}

// saveBtnApi 新增、修改按钮信息
export const saveBtnApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/button/save', data})
}
// delBtnsApi 批量删除按钮信息
export const delBtnsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/button/deletes', data})
}
// oneBtnApi 获取按钮详情信息
export const oneBtnApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/button/one', params})
}
// pageBtnApi 获取按钮分页列表信息
export const pageBtnApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/button/page', params})
}
// sortBtnApi 获取按钮数量，用于排序
export const sortBtnApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/button/sort', params})
}

// saveRoleApi 新增、修改角色信息
export const saveRoleApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/role/save', data})
}
// delRolesApi 删除角色信息
export const delRolesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/role/deletes', data})
}
// oneRoleApi 获取角色详情信息
export const oneRoleApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/role/one', params})
}
// pageRoleApi 获取角色信息分页列表
export const pageRoleApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/role/page', params})
}
// selRoleApi 获取角色下拉列表
export const selRoleApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/role/select', params})
}

// saveUserApi 新增、修改用户信息
export const saveUserApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/save', data})
}
// procUsersApi 删除、审核、取消审核用户信息
export const procUsersApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/process', data})
}
// oneUserApi 获取用户详情信息
export const oneUserApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/one', params})
}
// pageUserApi 获取用户信息分页列表
export const pageUserApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/page', params})
}
// personalApi 修改个人资料
export const personalApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/user/personal', data})
}
// selUserApi 获取角色信息分页列表
export const selUserApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/user/select', params})
}

// saveTypeApi 新增、修改分类信息
export const saveTypeApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/type/save', data})
}
// delTypesApi 批量删除分类信息
export const delTypesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/type/deletes', data})
}
// oneTypeApi 获取分类详情信息
export const oneTypeApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/type/one', params})
}
// listTypeApi 获取分类信息树形列表
export const listTypeApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/type/list', params})
}
// treeTypeApi 获取分类信息树形列表
export const treeTypeApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/type/tree', params})
}
// sortTypeApi 获取分类信息树形列表
export const sortTypeApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/type/sort', params})
}

// saveDictApi 新增、修改数据字典信息
export const saveDictApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/dict/save', data})
}
// delDictsApi 批量删除数据字典信息
export const delDictsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/dict/deletes', data})
}
// oneDictApi 获取数据字典详情信息
export const oneDictApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/one', params})
}
// pageDictApi 获取数据字典分页列表信息
export const pageDictApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/page', params})
}
// selDictApi 获取数据字典下拉选择信息
export const selDictApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/select', params})
}
// sortDictApi 获取数据字典数量，用于排序
export const sortDictApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/dict/sort', params})
}

// pageNoteApi 获取消息分页列表
export const pageNoteApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/notice/page', params})
}
// procNotesApi 批量删除、已读消息
export const procNotesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/notice/process', data})
}
// readNoteApi 已读消息
export const readNoteApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/notice/read', data})
}
// oneNoteApi 获取消息详情
export const oneNoteApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/notice/one', params})
}

// pageLogApi 获取日志信息分页列表
export const pageLogApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/log/page', params})
}

// addFileApi 添加文件
export const addFileApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/upload', headers: {'content-type': 'multipart/form-data'}, data})
}
// upImgApi 上传图片
export const upImgApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/image', headers: {'content-type': 'multipart/form-data'}, data})
}
// upVideoApi 上传视频
export const upVideoApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/video', headers: {'content-type': 'multipart/form-data'}, data})
}
// updNameApi 修改文件名称
export const updNameApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/upd-name', data})
}
// updTypeApi 修改文件分类
export const updTypeApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/upd-type', data})
}
// delFilesApi 批量删除文件
export const delFilesApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/deletes', data})
}
// delFileApi 删除文件
export const delFileApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/file/delete', data})
}
// oneFileApi 获取文件详情信息
export const oneFileApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/file/one', params})
}
// pageFileApi 获取文件分页列表
export const pageFileApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/file/page', params})
}

// pageTagApi 获取标签分页列表
export const pageTagApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/system/tag/page', params})
}
// saveTagApi 保存标签
export const saveTagApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/save', data})
}
// delTagsApi 批量删除标签
export const delTagsApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/deletes', data})
}
// addTagApi 保存标签
export const addTagApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/add', data})
}
// delTagApi 删除标签
export const delTagApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/system/tag/delete', data})
}

// saveInfoApi 新增、修改资讯信息
export const saveInfoApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/information/save', data})
}
// procInfosApi 删除、审核，以及取消审核资讯信息
export const procInfosApi = (data) => {
  return request({method: 'POST', url: baseUrl.sysUrl + '/information/process', data})
}
// oneInfoApi 获取资讯详情信息
export const oneInfoApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/information/one', params})
}
// pageInfoApi 获取资讯信息分页列表
export const pageInfoApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/information/page', params})
}
// sortInfoApi 获取资讯信息数量
export const sortInfoApi = (params) => {
  return request({method: 'GET', url: baseUrl.sysUrl + '/information/sort', params})
}
